<?php
namespace app\user\event\listeners\user;

use app\user\logic\user\Account;

/**
 * 创建用户授权
 */
class UserLastLogin
{
    public static function handle(Account $user)
    {
        if ($user->getAttr('id')) {
            $user->last_login_ip   = request()->ip();
            $user->last_login_time = request()->time();
            $user->save();
        }
    }
}
